<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Verbs</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Verbs' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../services.html">Services</a></li><li><a href="index.html">linguistics</a></li><li><a href="index.html#3">Chapter 3: VP Categories</a></li><li><b>Verbs</b></li></ul></div>
<p class="purpose">To record the identity and different structural forms of verbs.</p>

<ul class="toc"><li><a href="3-vrb.html#SP1">&#167;1. Verb Identities</a></li><li><a href="3-vrb.html#SP5">&#167;5. Operator Verbs</a></li><li><a href="3-vrb.html#SP6">&#167;6. Verb Forms</a></li><li><a href="3-vrb.html#SP10">&#167;10. Verb senses</a></li><li><a href="3-vrb.html#SP11">&#167;11. Creating forms and senses</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. Verb Identities.</b>What is a verb? Are the verbs in "Peter is hungry" and "Jane will be in the
Dining Room" the same? How about in "Donald Trump lies on the television" and
"My cat Donald lies on the television"? This isn't so easy to answer.
</p>

<p class="commentary">For our purposes two usages of a verbs are "the same verb" if they ultimately
come from the same instance of the following structure; this essentially
defines a verb as a combination of its inflected forms with its possible
usages in a sentence.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">conjugation</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="identifier-syntax">first_form</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="identifier-syntax">base_form</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">linguistic_stock_item</span><span class="plain-syntax"> *</span><span class="identifier-syntax">in_stock</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">VERB_COMPILATION_LINGUISTICS_CALLBACK</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb_compilation_data</span><span class="plain-syntax"> </span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">endif</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">verb</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure verb is accessed in 2/adj, 2/art, 2/daq, 2/nns, 2/prn, 3/vu, 3/prp, 4/vp and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>Verbs are a grammatical category:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">grammatical_category</span><span class="plain-syntax"> *</span><span class="identifier-syntax">verbs_category</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Verbs::create_category</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Verbs::create_category</span></span>:<br/>Stock Control - <a href="1-sc.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">verbs_category</span><span class="plain-syntax"> = </span><a href="1-sc.html#SP3" class="function-link"><span class="function-syntax">Stock::new_category</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"verb"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">verbs_category</span><span class="plain-syntax">, </span><span class="constant-syntax">LOG_GRAMMATICAL_CATEGORY_MTID</span><span class="plain-syntax">, </span><a href="3-vrb.html#SP2" class="function-link"><span class="function-syntax">Verbs::log_item</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Verbs::log_item</span><span class="plain-syntax">(</span><span class="reserved-syntax">grammatical_category</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cat</span><span class="plain-syntax">, </span><span class="identifier-syntax">general_pointer</span><span class="plain-syntax"> </span><span class="identifier-syntax">data</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RETRIEVE_POINTER_verb</span><span class="plain-syntax">(</span><span class="identifier-syntax">data</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-vrb.html#SP4" class="function-link"><span class="function-syntax">Verbs::log_verb</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">DL</span><span class="plain-syntax">, </span><span class="identifier-syntax">V</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="function-syntax">Verbs::from_lcon</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Verbs::from_lcon</span></span>:<br/>Verb Usages - <a href="3-vu.html#SP12">&#167;12</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">lcon_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">lcon</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">linguistic_stock_item</span><span class="plain-syntax"> *</span><span class="identifier-syntax">item</span><span class="plain-syntax"> = </span><a href="1-sc.html#SP8" class="function-link"><span class="function-syntax">Stock::from_lcon</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lcon</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">item</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">RETRIEVE_POINTER_verb</span><span class="plain-syntax">(</span><span class="identifier-syntax">item</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">data</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">lcon_ti</span><span class="plain-syntax"> </span><span class="function-syntax">Verbs::to_lcon</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">Verbs::to_lcon</span></span>:<br/>Verb Usages - <a href="3-vu.html#SP7_1_2_1">&#167;7.1.2.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">v</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="1-sc.html#SP8" class="function-link"><span class="function-syntax">Stock::to_lcon</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">v</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">in_stock</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>Note also that every verb always has a bare form, where no prepositions are
combined with it. This is (initially) meaningless, but it always exists.
</p>

<p class="commentary">Finally, note that the conjugation can be null. This is used only for
what we'll call "operator verbs", where a mathematical operator is used
instead of a word: for example, the <span class="extract"><span class="extract-syntax">&lt;=</span></span> sign is such a verb in Inform.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">copular_verb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="function-syntax">Verbs::new_verb</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">Verbs::new_verb</span></span>:<br/><a href="3-vrb.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">cop</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">verb</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">conjugation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_form</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">base_form</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">VERB_COMPILATION_LINGUISTICS_CALLBACK</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">VERB_COMPILATION_LINGUISTICS_CALLBACK</span><span class="plain-syntax">(</span><span class="identifier-syntax">V</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">endif</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vrb.html#SP3_1" class="named-paragraph-link"><span class="named-paragraph">Give the new verb a single meaningless form</span><span class="named-paragraph-number">3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vrb.html#SP3_2" class="named-paragraph-link"><span class="named-paragraph">If this is the first copular verb, remember that</span><span class="named-paragraph-number">3.2</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">in_stock</span><span class="plain-syntax"> = </span><a href="1-sc.html#SP6" class="function-link"><span class="function-syntax">Stock::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">verbs_category</span><span class="plain-syntax">, </span><span class="identifier-syntax">STORE_POINTER_verb</span><span class="plain-syntax">(</span><span class="identifier-syntax">V</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">VERB_FORMS</span><span class="plain-syntax">, </span><span class="string-syntax">"New verb: $w\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">V</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">V</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3_1" class="paragraph-anchor"></a><b>&#167;3.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Give the new verb a single meaningless form</span><span class="named-paragraph-number">3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="3-vrb.html#SP12" class="function-link"><span class="function-syntax">Verbs::add_form</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">V</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><a href="3-vm.html#SP4" class="function-link"><span class="function-syntax">VerbMeanings::meaninglessness</span></a><span class="plain-syntax">(), </span><span class="constant-syntax">SVO_FS_BIT</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vrb.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3_2" class="paragraph-anchor"></a><b>&#167;3.2. </b>Note that the first verb submitted with the copular flag set is considered
to be the definitive copular verb.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">If this is the first copular verb, remember that</span><span class="named-paragraph-number">3.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">cop</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">copular_verb</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">vc</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">WordAssemblages::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">infinitive</span><span class="plain-syntax">))) </span><span class="identifier-syntax">copular_verb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">V</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vrb.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Verbs::log_verb</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">Verbs::log_verb</span></span>:<br/><a href="3-vrb.html#SP2">&#167;2</a><br/>Linguistics Module - <a href="1-lm.html#SP3_2">&#167;3.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vvi</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">vvi</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">V</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) { </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;no-V&gt;"</span><span class="plain-syntax">); }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">conjugation</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%A"</span><span class="plain-syntax">, &amp;(</span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">conjugation</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">infinitive</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"(unconjugated)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"(%d)"</span><span class="plain-syntax">, </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. Operator Verbs.</b>As noted above, these are tenseless verbs with no conjugation, represented
only by symbols such as <span class="extract"><span class="extract-syntax">&lt;=</span></span>. As infix operators, they mimic SVO sentence
structures.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="function-syntax">Verbs::new_operator_verb</span><span class="plain-syntax">(</span><span class="reserved-syntax">verb_meaning</span><span class="plain-syntax"> </span><span class="identifier-syntax">vm</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax"> = </span><a href="3-vrb.html#SP3" class="function-link"><span class="function-syntax">Verbs::new_verb</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-vrb.html#SP12" class="function-link"><span class="function-syntax">Verbs::add_form</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">V</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">vm</span><span class="plain-syntax">, </span><span class="constant-syntax">SVO_FS_BIT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">V</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. Verb Forms.</b>A "verb form" is a way to use a given verb in a sentence. This may require
up to two different prepositions to be used. For example, "Peter is hungry"
and "Jane will be in the Dining Room" exhibit two different verb forms:
"to be" with no preposition (meaning that the object phrase, "hungry", is
not introduced by a preposition), and "to be" with the preposition "in".
</p>

<p class="commentary">It's not always the case that the preposition follows the verb, even when
it directly introduces the object, because of a quirk of English called
inversion: for example "In the Dining Room is Jane" locates "in" far from
"is". But the first preposition, if given, always introduces the object
phrase. If it's not given, the object phrase has no introduction, as in
the sentence "Peter is hungry".
</p>

<p class="commentary">The second clause preposition is again optional. This marks that the verb
takes two object phrases, and provides a preposition to introduce the
second of these. For example, in "X translates into Y as Z", the verb
is "translate", the first preposition is "into", and the second is "as".
In "X ends Y when Z", the first preposition is null, and the second is "when".
</p>

<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. </b>A "form structure" is a possible way in which a verb form can be expressed.
SVO means "subject, verb, object", as in "Peter likes Jane"; VOO means
"verb, object, object", as in "Test me with ...", and so on. Since multiple
form usages can be legal for the same form, this is a bitmap:
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">SVO_FS_BIT</span><span class="plain-syntax">          </span><span class="constant-syntax">1</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">VO_FS_BIT</span><span class="plain-syntax">           </span><span class="constant-syntax">2</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">SVOO_FS_BIT</span><span class="plain-syntax">         </span><span class="constant-syntax">4</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">VOO_FS_BIT</span><span class="plain-syntax">          </span><span class="constant-syntax">8</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. </b>So here's the verb form:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">underlying_verb</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">preposition</span><span class="plain-syntax"> *</span><span class="reserved-syntax">preposition</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">preposition</span><span class="plain-syntax"> *</span><span class="identifier-syntax">second_clause_preposition</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">form_structures</span><span class="plain-syntax">; </span><span class="comment-syntax"> bitmap of </span><span class="extract"><span class="extract-syntax">*_FS_BIT</span></span><span class="comment-syntax"> values</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">infinitive_reference_text</span><span class="plain-syntax">; </span><span class="comment-syntax"> e.g. "translate into"</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">pos_reference_text</span><span class="plain-syntax">; </span><span class="comment-syntax"> e.g. "translate into"</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">neg_reference_text</span><span class="plain-syntax">; </span><span class="comment-syntax"> e.g. "do not translate into"</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_sense</span><span class="plain-syntax"> *</span><span class="identifier-syntax">list_of_senses</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_meaning</span><span class="plain-syntax"> *</span><span class="identifier-syntax">first_unspecial_meaning</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="identifier-syntax">next_form</span><span class="plain-syntax">; </span><span class="comment-syntax"> within the linked list for the verb</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">linguistic_stock_item</span><span class="plain-syntax"> *</span><span class="identifier-syntax">in_stock</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">VERB_FORM_COMPILATION_LINGUISTICS_CALLBACK</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb_form_compilation_data</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb_form_compilation</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">endif</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">verb_form</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure verb_form is accessed in 2/adj, 2/art, 2/daq, 2/nns, 2/prn, 3/vu, 3/prp, 4/vp and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>Verb forms are also a grammatical category:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">grammatical_category</span><span class="plain-syntax"> *</span><span class="identifier-syntax">verb_forms_category</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Verbs::create_forms_category</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">Verbs::create_forms_category</span></span>:<br/>Stock Control - <a href="1-sc.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">verb_forms_category</span><span class="plain-syntax"> = </span><a href="1-sc.html#SP3" class="function-link"><span class="function-syntax">Stock::new_category</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"verb_form"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">verb_forms_category</span><span class="plain-syntax">, </span><span class="constant-syntax">LOG_GRAMMATICAL_CATEGORY_MTID</span><span class="plain-syntax">, </span><a href="3-vrb.html#SP9" class="function-link"><span class="function-syntax">Verbs::log_form_item</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Verbs::log_form_item</span><span class="plain-syntax">(</span><span class="reserved-syntax">grammatical_category</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cat</span><span class="plain-syntax">, </span><span class="identifier-syntax">general_pointer</span><span class="plain-syntax"> </span><span class="identifier-syntax">data</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vf</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RETRIEVE_POINTER_verb_form</span><span class="plain-syntax">(</span><span class="identifier-syntax">data</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-vrb.html#SP9" class="function-link"><span class="function-syntax">Verbs::log_form</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Verbs::log_form</span><span class="plain-syntax">(</span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vf</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"$w + $p + $p"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">underlying_verb</span><span class="plain-syntax">, </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">preposition</span><span class="plain-syntax">, </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">second_clause_preposition</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">form_structures</span><span class="plain-syntax"> &amp; </span><span class="constant-syntax">SVO_FS_BIT</span><span class="plain-syntax">) </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">" SVO"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">form_structures</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">VO_FS_BIT</span><span class="plain-syntax">) </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">" VO"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">form_structures</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">SVOO_FS_BIT</span><span class="plain-syntax">) </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">" SVOO"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">form_structures</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">VOO_FS_BIT</span><span class="plain-syntax">) </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">" VOO"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. Verb senses.</b>In this model, a verb can have multiple senses. Inform makes little use of
that in verbs created by the user, but for example "X is Y" has more than
a dozen different senses. (Inform distinguishes them on a case by case basis,
by looking at X and Y.)
</p>

<p class="commentary">The following structure is just a holder for a "verb meaning", so that it
can be joined into a linked list. Verb meanings are described elsewhere.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_sense</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_meaning</span><span class="plain-syntax"> </span><span class="identifier-syntax">vm</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">verb_sense</span><span class="plain-syntax"> *</span><span class="identifier-syntax">next_sense</span><span class="plain-syntax">; </span><span class="comment-syntax"> within the linked list for the verb form</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">verb_sense</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure verb_sense is accessed in 3/vu, 3/prp, 4/vp and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. Creating forms and senses.</b>Forms are stored in a linked list, and are uniquely identified by the triplet
of verb and two prepositions.
</p>

<p class="commentary">The base form is by definition the one where no prepositions are used. We could
therefore find that base form by calling <span class="extract"><span class="extract-syntax">Verbs::find_form(V, NULL, NULL)</span></span>,
but instead we cache this result in <span class="extract"><span class="extract-syntax">V-&gt;base_form</span></span> for speed: profiling shows
that Inform otherwise spends nearly 1% of its entire running time making that
innocent-looking call.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="function-syntax">Verbs::base_form</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">Verbs::base_form</span></span>:<br/>Verb Meanings - <a href="3-vm.html#SP7">&#167;7</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">V</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">base_form</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="function-syntax">Verbs::find_form</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">Verbs::find_form</span></span>:<br/><a href="3-vrb.html#SP12_1">&#167;12.1</a><br/>Verb Usages - <a href="3-vu.html#SP12">&#167;12</a><br/>Noun Phrases - <a href="4-np.html#SP15_1">&#167;15.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax">, </span><span class="reserved-syntax">preposition</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prep</span><span class="plain-syntax">, </span><span class="reserved-syntax">preposition</span><span class="plain-syntax"> *</span><span class="identifier-syntax">second_prep</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">V</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vf</span><span class="plain-syntax"> = </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_form</span><span class="plain-syntax">; </span><span class="identifier-syntax">vf</span><span class="plain-syntax">; </span><span class="identifier-syntax">vf</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_form</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">preposition</span><span class="plain-syntax"> == </span><span class="identifier-syntax">prep</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">second_clause_preposition</span><span class="plain-syntax"> == </span><span class="identifier-syntax">second_prep</span><span class="plain-syntax">))</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">vf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. </b>And here's how we add them.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Verbs::add_form</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">Verbs::add_form</span></span>:<br/><a href="3-vrb.html#SP3_1">&#167;3.1</a>, <a href="3-vrb.html#SP5">&#167;5</a><br/>Verb Usages - <a href="3-vu.html#SP6_1">&#167;6.1</a>, <a href="3-vu.html#SP7">&#167;7</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax">, </span><span class="reserved-syntax">preposition</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prep</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">preposition</span><span class="plain-syntax"> *</span><span class="identifier-syntax">second_prep</span><span class="plain-syntax">, </span><span class="reserved-syntax">verb_meaning</span><span class="plain-syntax"> </span><span class="identifier-syntax">vm</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">form_structs</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-vm.html#SP4" class="function-link"><span class="function-syntax">VerbMeanings::is_meaningless</span></a><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">vm</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">VERB_FORMS</span><span class="plain-syntax">, </span><span class="string-syntax">"  Adding form: $w + $p + $p = $y\n"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">V</span><span class="plain-syntax">, </span><span class="identifier-syntax">prep</span><span class="plain-syntax">, </span><span class="identifier-syntax">second_prep</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">vm</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><a href="3-vm.html#SP8" class="function-link"><span class="function-syntax">VerbMeanings::set_where_assigned</span></a><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">vm</span><span class="plain-syntax">, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">V</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"added form to null verb"</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vf</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-vrb.html#SP12_1" class="named-paragraph-link"><span class="named-paragraph">Find or create the verb form structure for this combination</span><span class="named-paragraph-number">12.1</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">form_structures</span><span class="plain-syntax"> = ((</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">form_structures</span><span class="plain-syntax">) | </span><span class="identifier-syntax">form_structs</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="3-vm.html#SP4" class="function-link"><span class="function-syntax">VerbMeanings::is_meaningless</span></a><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">vm</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">list_of_senses</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-vrb.html#SP12_2" class="named-paragraph-link"><span class="named-paragraph">Add this meaning as a new sense of the verb form</span><span class="named-paragraph-number">12.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12_1" class="paragraph-anchor"></a><b>&#167;12.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Find or create the verb form structure for this combination</span><span class="named-paragraph-number">12.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">vf</span><span class="plain-syntax"> = </span><a href="3-vrb.html#SP11" class="function-link"><span class="function-syntax">Verbs::find_form</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">V</span><span class="plain-syntax">, </span><span class="identifier-syntax">prep</span><span class="plain-syntax">, </span><span class="identifier-syntax">second_prep</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vf</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">verb_form</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">underlying_verb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">V</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">preposition</span><span class="plain-syntax"> = </span><span class="identifier-syntax">prep</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">second_clause_preposition</span><span class="plain-syntax"> = </span><span class="identifier-syntax">second_prep</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">form_structures</span><span class="plain-syntax"> = </span><span class="identifier-syntax">form_structs</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">list_of_senses</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_form</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_unspecial_meaning</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">VERB_FORM_COMPILATION_LINGUISTICS_CALLBACK</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">VERB_FORM_COMPILATION_LINGUISTICS_CALLBACK</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-vrb.html#SP12_1_1" class="named-paragraph-link"><span class="named-paragraph">Compose the reference texts for the new form</span><span class="named-paragraph-number">12.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-vrb.html#SP12_1_2" class="named-paragraph-link"><span class="named-paragraph">Insert the new form into the list of forms for this verb</span><span class="named-paragraph-number">12.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">in_stock</span><span class="plain-syntax"> = </span><a href="1-sc.html#SP6" class="function-link"><span class="function-syntax">Stock::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">verb_forms_category</span><span class="plain-syntax">, </span><span class="identifier-syntax">STORE_POINTER_verb_form</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vrb.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_1_1" class="paragraph-anchor"></a><b>&#167;12.1.1. </b>The reference texts are just for convenience, really: they express the form
in a canonical verbal form. For example, "translate into <span class="extract"><span class="extract-syntax">+</span></span> as".
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compose the reference texts for the new form</span><span class="named-paragraph-number">12.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">verb_conjugation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">conjugation</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><a href="3-vu.html#SP24" class="function-link"><span class="function-syntax">VerbUsages::adaptive_person</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">defined_in</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax"> = </span><a href="3-vu.html#SP24" class="function-link"><span class="function-syntax">VerbUsages::adaptive_number</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">defined_in</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">we_form</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">tabulations</span><span class="plain-syntax">[</span><span class="identifier-syntax">ACTIVE_VOICE</span><span class="plain-syntax">].</span><span class="identifier-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">IS_TENSE</span><span class="plain-syntax">][</span><span class="identifier-syntax">POSITIVE_SENSE</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">]);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">we_dont_form</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">tabulations</span><span class="plain-syntax">[</span><span class="identifier-syntax">ACTIVE_VOICE</span><span class="plain-syntax">].</span><span class="identifier-syntax">vc_text</span><span class="plain-syntax">[</span><span class="identifier-syntax">IS_TENSE</span><span class="plain-syntax">][</span><span class="identifier-syntax">NEGATIVE_SENSE</span><span class="plain-syntax">][</span><span class="identifier-syntax">p</span><span class="plain-syntax">][</span><span class="identifier-syntax">n</span><span class="plain-syntax">]);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive_reference_text</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vc</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">infinitive</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pos_reference_text</span><span class="plain-syntax"> = </span><span class="identifier-syntax">we_form</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">neg_reference_text</span><span class="plain-syntax"> = </span><span class="identifier-syntax">we_dont_form</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">prep</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive_reference_text</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive_reference_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">prep</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">prep_text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pos_reference_text</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pos_reference_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">prep</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">prep_text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">neg_reference_text</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">neg_reference_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">prep</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">prep_text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">second_prep</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">word_assemblage</span><span class="plain-syntax"> </span><span class="identifier-syntax">plus</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::lit_1</span><span class="plain-syntax">(</span><span class="identifier-syntax">PLUS_V</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive_reference_text</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive_reference_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">plus</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pos_reference_text</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pos_reference_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">plus</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">neg_reference_text</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">neg_reference_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">plus</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive_reference_text</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive_reference_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">second_prep</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">prep_text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pos_reference_text</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pos_reference_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">second_prep</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">prep_text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">neg_reference_text</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WordAssemblages::join</span><span class="plain-syntax">(</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">neg_reference_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">second_prep</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">prep_text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infinitive_reference_text</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::new_assemblage</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pos_reference_text</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::new_assemblage</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">neg_reference_text</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAssemblages::new_assemblage</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vrb.html#SP12_1">&#167;12.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_1_2" class="paragraph-anchor"></a><b>&#167;12.1.2. </b>The list of forms for a verb is in order of preposition length.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Insert the new form into the list of forms for this verb</span><span class="named-paragraph-number">12.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prev</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">evf</span><span class="plain-syntax"> = </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_form</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (; </span><span class="identifier-syntax">evf</span><span class="plain-syntax">; </span><span class="identifier-syntax">prev</span><span class="plain-syntax"> = </span><span class="identifier-syntax">evf</span><span class="plain-syntax">, </span><span class="identifier-syntax">evf</span><span class="plain-syntax"> = </span><span class="identifier-syntax">evf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_form</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-prp.html#SP7" class="function-link"><span class="function-syntax">Prepositions::length</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">prep</span><span class="plain-syntax">) &gt; </span><a href="3-prp.html#SP7" class="function-link"><span class="function-syntax">Prepositions::length</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">evf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">preposition</span><span class="plain-syntax">)) </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">prev</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_form</span><span class="plain-syntax"> = </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_form</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_form</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_form</span><span class="plain-syntax"> = </span><span class="identifier-syntax">prev</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_form</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">prev</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_form</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">prep</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">second_prep</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)) </span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">base_form</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vf</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vrb.html#SP12_1">&#167;12.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_2" class="paragraph-anchor"></a><b>&#167;12.2. </b>A new sense is normally just added to the end of the list of senses for
the given form, except that if there's a meaningless sense present already,
we overwrite that with the new (presumably meaningful) one.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Add this meaning as a new sense of the verb form</span><span class="named-paragraph-number">12.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">verb_sense</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">list_of_senses</span><span class="plain-syntax">, *</span><span class="identifier-syntax">prev</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vs</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-vm.html#SP4" class="function-link"><span class="function-syntax">VerbMeanings::is_meaningless</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vm</span><span class="plain-syntax">))) { </span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vm</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vm</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">prev</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vs</span><span class="plain-syntax">; </span><span class="identifier-syntax">vs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_sense</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vs</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">verb_sense</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vm</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vm</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_sense</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">prev</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">list_of_senses</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vs</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">prev</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_sense</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vs</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-vm.html#SP10" class="function-link"><span class="function-syntax">VerbMeanings::get_special_meaning</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vm</span><span class="plain-syntax">)) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_unspecial_meaning</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vm</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_unspecial_meaning</span><span class="plain-syntax"> == &amp;(</span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vm</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_unspecial_meaning</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-vrb.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. </b>The following function may seem curious &mdash; what's so great about the first
regular sense of a verb? The answer is that Inform generally gives a verb at
most one regular sense.
</p>

<p class="commentary">We cache the result in <span class="extract"><span class="extract-syntax">vf-&gt;first_unspecial_meaning</span></span> for speed, because profiling
of <a href="../inform7/index.html" class="internal">inform7</a> suggests this is worth it, but retain the uncached algorithm as
well in case we suspect bugs in future.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">CACHE_FIRST_UNSPECIAL_MEANING</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">verb_meaning</span><span class="plain-syntax"> *</span><span class="function-syntax">Verbs::first_unspecial_meaning_of_verb_form</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">Verbs::first_unspecial_meaning_of_verb_form</span></span>:<br/>Verb Meanings - <a href="3-vm.html#SP7">&#167;7</a>, <a href="3-vm.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vf</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vf</span><span class="plain-syntax">)  {</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="constant-syntax">CACHE_FIRST_UNSPECIAL_MEANING</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first_unspecial_meaning</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">ifndef</span><span class="plain-syntax"> </span><span class="constant-syntax">CACHE_FIRST_UNSPECIAL_MEANING</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">verb_sense</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">list_of_senses</span><span class="plain-syntax">; </span><span class="identifier-syntax">vs</span><span class="plain-syntax">; </span><span class="identifier-syntax">vs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_sense</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-vm.html#SP10" class="function-link"><span class="function-syntax">VerbMeanings::get_special_meaning</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vm</span><span class="plain-syntax">)) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> &amp;(</span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vm</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP14" class="paragraph-anchor"></a><b>&#167;14. </b>This is useful for indexing:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Verbs::has_special_meanings</span><span class="plain-syntax">(</span><span class="reserved-syntax">verb_form</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vf</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vf</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">verb_sense</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vf</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">list_of_senses</span><span class="plain-syntax">; </span><span class="identifier-syntax">vs</span><span class="plain-syntax">; </span><span class="identifier-syntax">vs</span><span class="plain-syntax"> = </span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next_sense</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-vm.html#SP10" class="function-link"><span class="function-syntax">VerbMeanings::get_special_meaning</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">vs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vm</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="2-prn.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-lm.html">1</a></li><li class="progresschapter"><a href="2-adj.html">2</a></li><li class="progresscurrentchapter">3</li><li class="progresscurrent">vrb</li><li class="progresssection"><a href="3-vm.html">vm</a></li><li class="progresssection"><a href="3-sm.html">sm</a></li><li class="progresssection"><a href="3-vu.html">vu</a></li><li class="progresssection"><a href="3-prp.html">prp</a></li><li class="progresssection"><a href="3-aoc.html">aoc</a></li><li class="progresssection"><a href="3-apoo.html">apoo</a></li><li class="progresschapter"><a href="4-np.html">4</a></li><li class="progressnext"><a href="3-vm.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

